package com.soft.service;

import java.util.ArrayList;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.soft.entity.Goods;
import com.soft.entity.Goodsloc;
import com.soft.mapper.GoodsMapper;
import com.soft.mapper.GoodslocMapper;

	@Service
	public class GoodslocService {
	@Autowired
	private GoodsMapper goodsMapper;
	@Autowired 
    private GoodslocMapper goodslocMapper;
     
	 public List<Goodsloc> queryByGoodsName(String goodsName){
	    	QueryWrapper<Goods> goodsWrapper=new QueryWrapper<>();
	    	goodsWrapper.eq("goods_name",goodsName);
	    	Goods goods =goodsMapper.selectOne(goodsWrapper);
	    	QueryWrapper<Goodsloc> goodslocWrapper =new QueryWrapper<>();
	    	goodslocWrapper.eq("goodsloc_id",goods.getGoodslocid());
	    	List<Goodsloc> goodsloclist =goodslocMapper.selectList(goodslocWrapper);
	    	return goodsloclist;
	    }
}